<include file="Public:head" />
<link href="__APP__/Application/{$Think.MODULE_NAME}/Public/css/login.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/js/jquery/validate.js"></script>
<script type="text/javascript">
    function findPwd(){
        var email = $('#email').val();
        $.post("{:U('Pwd/findPwd')}",{
            email:email
        },function(data){
            if(data == -1){
                showTip('系统提示','邮箱不存在',2,1.5);
            }else{
                $('#showInfo').show();
            }
        })
    }
</script>
<script type="text/javascript">
    $(function(){
        $("#form").validate({
            errorPlacement: function(error, element){
                var error_td = element.parent('li');
                error_td.find('label.error').hide();
                error_td.append(error);
            },
            submitHandler:function(form){
                findPwd()
            },
            rules: {
                email:{
                    required:true,
                    email : true
                },
                code : {
                    required : true,
                    remote   : {
                        url : "{:U('Order/checkCode')}",
                        type: 'post',
                        data:{
                            code : function(){
                                return $('#code').val();
                            }
                        }
                    }
                }
            },
            messages: {
                email : {
                    required : '请输入邮箱',
                    email	 : '邮箱格式有误'
                },
                code : {
                    required : '请输入验证码',
                    remote	 : '验证码有误'
                }
            }
        });
        $("#getcode_gg").click(function(){
            $(this).attr("src",'__PUBLIC__/js/group/code_gg.php?' + Math.random());
        });
    });
   
</script>
<div id="wrap">

    <!--end of header-->
    <div id="container" class="clearfix">
        <div class="login shadow">
            <div class="login-title">
                <h3>找回密码</h3>
            </div>
            <form id="form" method="POST" > 
                <ul>
                    <li class="sendMailTips"  style="margin-top:35px">
                        忘记了密码？请输入注册时填写的邮箱，我们会把密码邮件发送到您的邮箱！
                    </li>
                    <li class="login_mail">
                        <label for="Account">注册邮箱：</label>
                        <input name="email" autofocus type="text" id="email" />
                    </li>

                    <li class="login_password" style="width:100%">
                        <label>验证码：</label>
                        <input type="text" class="input login_input_1" name="code"  id="code"  tabindex="3" autocomplete="off" />
                        <img src="__PUBLIC__/js/group/code_gg.php" id="getcode_gg" title="看不清，点击换一张" align="absmiddle">
                    </li>                       
                    <li class="login_btn">
                        <input type="submit" id="sendToMail" value="完成"  />
                        <p id="showInfo" class="success" style="display: none">
                            密码已发送到您的邮箱，请尽快查收。
                            <a href="{:U('Login/index')}" style="color:blue">返回登录页面</a>
                        </p>
                    </li>
                    <div class="clear"></div>
                </ul>
            </form>

        </div>
        <!--end of login-->
    </div>
    <include file="Public:foot" />